package cn.tedu.demo;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;

public class Config {
    @Bean
    public Stu stu1(){
        Stu stu=new Stu("孙悟空","三年二班",588);
        return stu;
    }
    @Bean
    @Scope("prototype")
    public Stu stu2(){
        Stu stu=new Stu("猪八戒","三年五班",15);
        return stu;
    }
    @Bean
    @Lazy
    public Stu stu3(){
        Stu stu=new Stu("沙和尚","二年二班",679);
        return stu;
    }

}
